#!/usr/bin/env python
# -*- coding: utf-8 -*-
print("-".join(['张三','男','30']))

msg = "my name is {}, and age is {}"
print(msg.find('is'))#查找A,找到返回其索引， 找不到返回-1
print(msg.rfind('is'))#查找A,找到返回其索引， 找不到返回-1


st = 'hello kitty {name} age is {age}  '
print(st.count('l'))#统计 l出现次数
print(st.capitalize())
print(st.center(50,"#"))
print(st.endswith('tty3'))#判断字符串是否以 Li结尾
print(st.startswith('he'))

print("sun\tlong".expandtabs(10))#输出'Alex      Li'， 将\t转换成多长的空格

print(st.format(name='sunlong',age='100'))
print(st.format_map({'name':'sunlong','age':'99'}))

print('9'.isdigit()) #是否整数
print('9rrrr'.isprintable()) #是否是个非法字符
print('9rRrr'.islower()) #是否是个非法字符
print('9T'.isupper()) #是否是大写
print('   4  e '.isspace()) #是否是空格
print("My Name Is Sunlong".istitle())

msg = "abcde"
print(msg.upper())
print(msg.lower())
print(msg.swapcase())

n4 = "sun"
print(n4.ljust(40,"-"))
print(n4.rjust(40,"-"))

print(" sunlong\n ".strip())#去除换行和空格


print("alex li, chinese name is lijie".replace("li","LI",1))#替换

print("my name is sunlong".split())
print("my name is sunlong".split('n',1))
print("my name is sunlong".rsplit('n',1))